﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ALS.Communication.Contract;
using ALS.Communication.Contract.Actions;
using ALS.Communication.Contract.DTOs;
using ALS.Component.Tools.Helpers;

namespace ALS.Communication.Domain.Commends
{
    /// <summary>
    /// 打包
    /// </summary>
    public class StartWorkCmd : Cmd
    {
        public override Response Run(string requestBodyXml)
        {
            var responseBody = new StartWorkResponse() { Message = new MessageDTO() };
            var requestBody = GetRequestBody<StartWorkRequest>(requestBodyXml);
            var alsOrderPoco = AlsOrderRepository.Entities.SingleOrDefault(a => a.AlsOrderID == requestBody.AlsOrderID);

            if (alsOrderPoco != null)
            {
                //TODO 取商品数量信息，货架IP信息
                responseBody.Message.Success = true;
            }
            return GetResponse<StartWorkResponse>(responseBody);
        }
    }
}
